![]() ![]() |
Uniquely Identifying a Mac OS ComputerIn general, the only consistent serial number on a Mac OS -based computer is on the bar code label which is attached to the outside of the case. There is no internal serial number on the logic board of any current Mac OS-based computer. There is no internal serial number associated with the operating system. The only Macintosh with a real built-in serial number was the Macintosh XL. This machine had a serial number only because the Lisa (upon which it was based) had a serial number as part of the Lisa design. Since the Macintosh XL was discontinued in August of 1986, it is very rare, and not very relevant in today's market. There are some hardware devices, found on a limited range of Mac OS computers, which contain some unique identifier which could be used as a serial number. Examples are an installed Ethernet card or built-in Ethernet. (This is because Ethernet devices have an unique ID defined for each device.) Some (but not all) hard drives have a serial number which can be read using the SCSI Manager or ATA Manager. Other devices such as Token Ring cards or FireWire may also provide a unique identifier which may be used as a serial number. None of these hardware devices can be found across the entire Macintosh product line. Semi-Unique CharacteristicsThere are some "semi-unique" characteristics which you can use to help you determine if you are running software on the same machine which you were running on before. These are listed roughly in the order I'd recommend considering them. File ID ReferencesYou can create and store the
file ID reference for the application file. Create a file ID
reference using
GestaltThe Gestalt Manager gives you access to many pieces of
information which may help you uniquely identify a machine.
The obvious choices to help uniquely identify a machine are
the machine type (represented by the
Be aware that new revisions of System Software may change Gestalt selectors in ways you may not have anticipated. Ethernet AddressFor those Mac OS computers which have an Ethernet card
installed or built-in Ethernet, you can use the The complication for this technique is that the default Ethernet address may be overridden by a resource of type 'eadr' in the System file. This is documented in Inside Macintosh: Networking on page 11-26. Because it is easily possible to override the hardware address, and because Ethernet is not guaranteed to exist on any particular model, this is not a good scheme. Similar techniques can be used for a Mac OS computer with Token Ring cards or other cards, but a discussion of these cards is outside the scope of this document. Hard Disk Serial NumberSome hard disks have serial numbers. Many ATA/IDE drives have such a serial number, but most SCSI hard disks do not. Apple publishes ATA demo sample code which shows how to get the serial number of an ATA or IDE drive. Only some Macintosh models have ATA or IDE drives, so this is not a good general purpose scheme. SCSI Defect ListSome developers use the defect list from a SCSI drive. This won't work for a non-SCSI machine, but might be a good approach for a SCSI-based Mac. See the SCSI-2 specification and Inside Macintosh:Devices for details of using the SCSI Manager. Source code demonstrating use of the SCSI Manager in a general case is on the tool chest developer CD. Only some Macintosh models have SCSI drives, so this is not a good general purpose scheme. Directory ID of the System FolderCompare the dirID of the System Folder. Use
Volume Creation DateCompare the creation date of the volume. You can get this
information from
Network RegistrationRather than identifying a unique Macintosh, you may decide that you want to prevent multiple copies of the same application running on a network. The method some developers use is to register a fictitious device on the network using NBP (Name Binding Protocol) with the name being the single serial number of the license. (Of course, you still need a way of generating that serial number.) Other attempts to register the same device and serial number give an error that the program acts on to deny the use of the program. Chapter 3 of Inside Macintosh: Networking is a useful reference for NBP.
Things You Shouldn't DoYou should not rely on undocumented values with extended Parameter RAM (PRAM). Apple has only documented a limited portion of PRAM and will not document other parts; see Inside Macintosh:Operating System Utilities chapter 7 for details. Apple reserves the right to modify the meaning of any PRAM values not documented. Do not attempt to store information into PRAM beyond the documented areas. Such misuse of PRAM may result in extreme system instability. We discourage you from trying to use special tracks on formatted floppies, or special floppies. Apple does not document the floppy drive sufficiently for DTS to support such an action. Also, DiskCopy and other disk copying programs work very well at copying floppies, thus defeating such schemes. (DiskCopy was written inside Apple with access to the source of the floppy driver; we do not publish these details externally.) You should not rely on specific bizarre sectors of the hard disk (Apple relies on multiple vendors for its components. You cannot make undocumented assumptions about a particular machine or class of machines.)
ConclusionsThe schemes described here are simple ways to help uniquely identify a computer. Such schemes may be useful for simple copy protection. There are many more sophisticated schemes for serious copy protection. Some very good approaches use external hardware, such as ADB devices (called dongles) which help uniquely identify an authorized machine. If you are serious about copy protection, you should probably be contacting one of the many companies which specialize in copy protection solutions, rather than writing a solution yourself. Both hardware solutions (such as ADB dongles) and software solutions (such as licensing software) are widely available from third parties. SummaryThe Mac OS was not designed with copy protection in mind, and there is no unique serial number available across the entire set of Mac OS-based computers. There are some techniques which can be used to help differentiate between Mac OS computers, and these techniques are described in this technote. DTS does not support copy protection because of the significant compatibility liabilities it involves. DTS does not maintain expertise in copy protection techniques. ReferencesInside Macintosh: Networking, chapter 3, Name Binding Protocol Downloadables
|
Developer Documentation | Technical Q&As | Development Kits | Sample Code |